<?php
pdo_query("DROP TABLE IF EXISTS `ims_cqkundian_farm_about`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_about` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`phone` char(20) NOT NULL COMMENT '联系电话',
`send_price` float NOT NULL COMMENT '配送费',
`add_price` float NOT NULL,
`vet_banner` text NOT NULL COMMENT '兽医页面banner',
`home_title` char(100) NOT NULL COMMENT '首页标题',
`sign_integral` float NOT NULL COMMENT '签到获取积分',
`pay_integral` float NOT NULL COMMENT '支付获取积分',
`sign_banner` text NOT NULL COMMENT '签到banner',
`sign_rule` text NOT NULL COMMENT '积分规则',
`is_open_vet` tinyint(1) NOT NULL COMMENT '是否开启兽医版块',
`bar_title` char(50) NOT NULL COMMENT '首页顶部标题',
`farm_name` char(100) NOT NULL,
`farm_desc` text NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`animal_name` char(100) NOT NULL COMMENT '动物名称',
`animal_src` text NOT NULL COMMENT '动物图片',
`price` float NOT NULL COMMENT '领养价格',
`price_desc` char(200) NOT NULL COMMENT '价格说明',
`animal_type` char(50) NOT NULL COMMENT '动物品种',
`live_rate` float NOT NULL COMMENT '存活率',
`adopt_desc` text NOT NULL COMMENT '认养详情',
`mature_period` int(11) NOT NULL COMMENT '成熟期',
`meat_quality` char(100) NOT NULL COMMENT '肉质',
`animal_num` char(20) NOT NULL COMMENT '编号',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`animal_slide` text NOT NULL COMMENT '轮播图',
`is_putaway` tinyint(1) NOT NULL COMMENT '0/下架 1/上架',
`is_recommend` tinyint(1) NOT NULL COMMENT '0/不推荐1/推荐',
`is_open_sku` tinyint(1) NOT NULL COMMENT '0/关闭1/开启',
`animal_desc` char(200) NOT NULL COMMENT '说明',
`animal_rule` text NOT NULL COMMENT '领养规则',
`count` int(11) NOT NULL,
`sale_count` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_adopt`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_adopt` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '微擎uid',
`aid` int(11) NOT NULL COMMENT '动物id',
`create_time` int(11) NOT NULL COMMENT '领养时间',
`status` tinyint(1) NOT NULL COMMENT '0/未支付 1/待确定 2/l领养成功 3/死亡 4/已成熟 5/已宰杀斌配送',
`adopt_day` int(11) NOT NULL COMMENT '已喂养天数',
`predict_ripe` int(11) NOT NULL COMMENT '预计成熟期',
`uniacid` int(11) NOT NULL,
`order_id` int(11) NOT NULL COMMENT '订单编号',
`today_time` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_adopt_status`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_adopt_status` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`txt` text NOT NULL,
`src` text NOT NULL,
`create_time` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`adopt_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_number` char(30) NOT NULL,
`uid` int(11) NOT NULL,
`aid` int(11) NOT NULL COMMENT '动物ID',
`count` int(11) NOT NULL,
`total_price` float NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/未支付1已支付 2/已发货 ',
`pay_method` char(30) NOT NULL COMMENT '支付方式',
`pra_price` float NOT NULL COMMENT '实际支付金额',
`create_time` int(11) NOT NULL COMMENT '创建时间',
`uniacid` int(11) NOT NULL,
`spec_id` int(11) NOT NULL COMMENT '规格ID',
`body` char(50) NOT NULL,
`coupon_id` int(11) NOT NULL,
`coupon_price` float NOT NULL,
`username` char(50) NOT NULL,
`phone` char(50) NOT NULL,
`uniontid` char(200) NOT NULL,
`is_price` tinyint(1) NOT NULL,
`one_price` float NOT NULL,
`two_price` float NOT NULL,
`is_recycle` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_sku`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_sku` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`sku_name` char(100) NOT NULL COMMENT 'sku名称',
`price` float NOT NULL COMMENT '价格',
`count` int(11) NOT NULL COMMENT '库存',
`spec_num` char(20) NOT NULL COMMENT '货号',
`spec_src` text NOT NULL COMMENT '规格图片',
`aid` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`name` char(100) NOT NULL COMMENT '规格名称',
`aid` int(11) NOT NULL COMMENT '动物id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_animal_spec_value`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_animal_spec_value` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`spec_id` int(11) NOT NULL COMMENT '规格id',
`spec_value` char(100) NOT NULL COMMENT '规格值',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_article`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_id` int(11) NOT NULL COMMENT '分类ID',
`title` char(200) NOT NULL COMMENT '标题',
`cover` text NOT NULL COMMENT '封面',
`content` text NOT NULL COMMENT '内容',
`uniacid` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`view_count` int(11) NOT NULL COMMENT '浏览量',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_article_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_article_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_name` char(50) NOT NULL,
`rank` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_card`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_card` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`card_num` char(200) NOT NULL COMMENT '卡号',
`card_pwd` char(200) NOT NULL COMMENT '密码',
`import_time` int(11) NOT NULL COMMENT '导入时间',
`uid` int(11) NOT NULL COMMENT '用户uid',
`status` tinyint(1) NOT NULL COMMENT '0/未激活 1/已激活 2/已过期',
`uniacid` int(11) NOT NULL,
`use_time` int(11) NOT NULL COMMENT '使用时间',
`expire_time` int(11) NOT NULL COMMENT '过期时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_card_record`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_card_record` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`card_num` char(200) NOT NULL COMMENT '卡号',
`year` int(11) NOT NULL COMMENT '年',
`month` int(11) NOT NULL COMMENT '月',
`day` int(11) NOT NULL COMMENT '天',
`score` int(11) NOT NULL COMMENT '获取积分',
`uniacid` int(11) NOT NULL,
`create_time` int(11) NOT NULL COMMENT '签到时间',
`uid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_cart`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_cart` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`goods_id` int(11) NOT NULL,
`count` int(11) NOT NULL,
`price` float NOT NULL,
`goods_name` char(200) NOT NULL,
`cover` text NOT NULL,
`uniacid` int(11) NOT NULL,
`spec_id` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_distribution_check`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_distribution_check` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`username` char(100) NOT NULL COMMENT '用户名',
`phone` char(20) NOT NULL COMMENT '联系电话',
`status` tinyint(4) NOT NULL COMMENT '审核状态 0--未审核 1--审核通过 2--拒绝',
`create_time` int(11) NOT NULL,
`remark` text NOT NULL COMMENT '商家备注',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_form_id`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_form_id` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`formid` char(200) NOT NULL,
`uniacid` int(11) NOT NULL,
`openid` char(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_name` char(200) NOT NULL COMMENT '商品名称',
`cover` text NOT NULL COMMENT '封面图片',
`goods_desc` text NOT NULL COMMENT '商品简介',
`goods_slide` text NOT NULL COMMENT '轮播图片',
`is_put_away` tinyint(1) NOT NULL COMMENT '0/下架 1上架',
`is_recommend` tinyint(1) NOT NULL COMMENT '0/不推荐 1推荐',
`type_id` int(11) NOT NULL COMMENT '商品分类',
`goods_type` tinyint(4) NOT NULL COMMENT '0/普通商品 1/团购商品',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`is_open_sku` tinyint(1) NOT NULL COMMENT '0/无规格 1/有规格',
`price` float NOT NULL,
`count` int(11) NOT NULL,
`sale_count` int(11) NOT NULL,
`old_price` float NOT NULL,
`shop_type` tinyint(1) NOT NULL COMMENT '1普通商城2/组团商品 3/积分商城',
`send_goods_desc` text NOT NULL COMMENT '发货说明',
`send_price` float NOT NULL COMMENT '配送费',
`goods_video_src` text NOT NULL,
`trace_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_fumier`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_fumier` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trace_id` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`consommation` char(100) NOT NULL COMMENT '使用用量',
`name` char(100) NOT NULL COMMENT '肥料名称',
`area` float NOT NULL COMMENT '使用面积',
`use_time` int(11) NOT NULL COMMENT '使用时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_insec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_insec` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trace_id` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`consommation` char(100) NOT NULL COMMENT '使用用量',
`name` char(100) NOT NULL COMMENT '农药名称',
`area` float NOT NULL COMMENT '使用面积',
`use_time` int(11) NOT NULL COMMENT '使用时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`sku_name` char(100) NOT NULL COMMENT 'sku名称',
`price` float NOT NULL COMMENT '价格',
`count` int(11) NOT NULL COMMENT '库存',
`spec_num` char(20) NOT NULL COMMENT '货号',
`spec_src` text NOT NULL COMMENT '规格图片',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_trace`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_trace` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trace_id` int(11) NOT NULL,
`trace_name` char(100) NOT NULL,
`trace_desc` text NOT NULL,
`trace_time` int(11) NOT NULL,
`img` text NOT NULL,
`uniacid` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`rank` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_trace_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_trace_type` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`name` char(200) NOT NULL COMMENT '分类名称',
`rank` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_goods_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_goods_type` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`type_name` char(50) NOT NULL COMMENT '分类名称',
`icon` text NOT NULL COMMENT '分类图标',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`status` tinyint(1) NOT NULL COMMENT '0/隐藏 2/显示',
`create_time` int(11) NOT NULL COMMENT '添加时间',
`url_type` tinyint(1) NOT NULL COMMENT '1/普通商城2/组团商城',
`is_show_integral` tinyint(1) NOT NULL COMMENT '0/不显示1/显示',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`avatarurl` text NOT NULL,
`nickname` char(30) NOT NULL,
`uniacid` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/未完成1/已完成',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_goods`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_goods` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_name` char(200) NOT NULL COMMENT '商品名称',
`cover` text NOT NULL COMMENT '封面图片',
`goods_desc` text NOT NULL COMMENT '商品简介',
`goods_slide` text NOT NULL COMMENT '轮播图片',
`is_put_away` tinyint(1) NOT NULL COMMENT '0/下架 1上架',
`is_recommend` tinyint(1) NOT NULL COMMENT '0/不推荐 1推荐',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`is_open_sku` tinyint(1) NOT NULL COMMENT '0/无规格 1/有规格',
`price` float NOT NULL,
`count` int(11) NOT NULL,
`sale_count` int(11) NOT NULL,
`old_price` float NOT NULL,
`send_price` float NOT NULL COMMENT '运费',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_goods_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_goods_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`sku_name` char(100) NOT NULL COMMENT 'sku名称',
`price` float NOT NULL COMMENT '价格',
`count` int(11) NOT NULL COMMENT '库存',
`spec_num` char(20) NOT NULL COMMENT '货号',
`spec_src` text NOT NULL COMMENT '规格图片',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_order` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`order_number` char(50) NOT NULL,
`uid` int(11) NOT NULL,
`total_price` float NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/待支付 1/待配送 2/配送中 3/已完成 4/申请取消 5/已取消',
`pay_time` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`remark` char(200) NOT NULL,
`name` char(20) NOT NULL,
`address` char(200) NOT NULL,
`phone` char(20) NOT NULL,
`pay_method` char(20) NOT NULL,
`pra_price` float NOT NULL,
`send_number` char(30) NOT NULL COMMENT '快递单号',
`express_company` char(50) NOT NULL COMMENT '快递公司',
`send_price` float NOT NULL COMMENT '运费',
`add_price` float NOT NULL COMMENT '加工费',
`is_add` tinyint(4) NOT NULL COMMENT '0/不加工1/腊肉 2香肠',
`body` char(200) NOT NULL,
`coupon_id` int(11) NOT NULL,
`coupon_price` float NOT NULL,
`use_is_delete` tinyint(1) NOT NULL DEFAULT '0',
`uniontid` char(200) NOT NULL,
`is_price` tinyint(1) NOT NULL,
`one_price` float NOT NULL,
`two_price` float NOT NULL,
`is_recycle` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_order_detail`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_order_detail` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`goods_name` char(200) NOT NULL,
`cover` text NOT NULL,
`price` float NOT NULL,
`count` int(11) NOT NULL,
`spec_id` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`name` char(100) NOT NULL COMMENT '规格名称',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_group_spec_value`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_group_spec_value` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`spec_id` int(11) NOT NULL COMMENT '规格id',
`spec_value` char(100) NOT NULL COMMENT '规格值',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_home_set`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_home_set` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`title` char(100) NOT NULL,
`remark` char(200) NOT NULL,
`icon` text NOT NULL,
`rank` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`jump_url` char(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_home_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_home_type` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`type_name` char(20) NOT NULL COMMENT '分类名称',
`url` char(100) NOT NULL COMMENT '链接地址',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`rank` int(11) NOT NULL COMMENT '排序',
`status` tinyint(1) NOT NULL COMMENT '0/不显示 1/显示',
`icon` text NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_goods`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_goods` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_name` char(200) NOT NULL COMMENT '商品名称',
`cover` text NOT NULL COMMENT '封面图片',
`goods_desc` text NOT NULL COMMENT '商品简介',
`goods_slide` text NOT NULL COMMENT '轮播图片',
`is_put_away` tinyint(1) NOT NULL COMMENT '0/下架 1上架',
`is_recommend` tinyint(1) NOT NULL COMMENT '0/不推荐 1推荐',
`type_id` int(11) NOT NULL COMMENT '商品分类',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`is_open_sku` tinyint(1) NOT NULL COMMENT '0/无规格 1/有规格',
`price` float NOT NULL,
`count` int(11) NOT NULL,
`sale_count` int(11) NOT NULL,
`old_price` float NOT NULL,
`send_price` float NOT NULL COMMENT '运费',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_goods_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_goods_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`sku_name` char(100) NOT NULL COMMENT 'sku名称',
`price` float NOT NULL COMMENT '价格',
`count` int(11) NOT NULL COMMENT '库存',
`spec_num` char(20) NOT NULL COMMENT '货号',
`spec_src` text NOT NULL COMMENT '规格图片',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_goods_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_goods_type` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`type_name` char(50) NOT NULL COMMENT '分类名称',
`icon` text NOT NULL COMMENT '分类图标',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`status` tinyint(1) NOT NULL COMMENT '0/隐藏 2/显示',
`create_time` int(11) NOT NULL COMMENT '添加时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_order` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`order_number` char(50) NOT NULL,
`uid` int(11) NOT NULL,
`total_price` float NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/待支付 1/待配送 2/配送中 3/已完成 4/申请取消 5/已取消',
`pay_time` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`remark` char(200) NOT NULL,
`name` char(20) NOT NULL,
`address` char(200) NOT NULL,
`phone` char(20) NOT NULL,
`pay_method` char(20) NOT NULL,
`pra_price` float NOT NULL,
`send_number` char(30) NOT NULL COMMENT '快递单号',
`express_company` char(50) NOT NULL COMMENT '快递公司',
`send_price` float NOT NULL COMMENT '运费',
`body` char(200) NOT NULL,
`uniontid` char(200) NOT NULL,
`is_recycle` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_order_detail`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_order_detail` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`goods_name` char(200) NOT NULL,
`cover` text NOT NULL,
`price` float NOT NULL,
`count` int(11) NOT NULL,
`spec_id` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_record`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_record` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`score` float NOT NULL COMMENT '积分',
`create_time` int(11) NOT NULL,
`score_type` char(100) NOT NULL COMMENT '加减积分',
`uniacid` int(11) NOT NULL,
`body` char(100) NOT NULL COMMENT '积分操作',
`now_score` float NOT NULL COMMENT '操作后积分',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`name` char(100) NOT NULL COMMENT '规格名称',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_integral_spec_value`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_integral_spec_value` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`spec_id` int(11) NOT NULL COMMENT '规格id',
`spec_value` char(100) NOT NULL COMMENT '规格值',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_id` int(11) NOT NULL COMMENT '土地分类ID',
`all_area` float NOT NULL COMMENT '总面积',
`area` float NOT NULL COMMENT '以种植面积',
`residue_area` float NOT NULL COMMENT '剩余面积',
`rank` int(11) NOT NULL COMMENT '排序',
`uniacid` int(11) NOT NULL,
`cover` text NOT NULL COMMENT '封面',
`land_name` char(50) NOT NULL COMMENT '土地名称',
`price` float NOT NULL COMMENT '价格',
`seed` text NOT NULL COMMENT '可种植的种子',
`live_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land_buy_limit`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land_buy_limit` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`price` float NOT NULL COMMENT '价格',
`day` int(11) NOT NULL COMMENT '天',
`uniacid` int(11) NOT NULL,
`status` tinyint(4) NOT NULL COMMENT '0/不显示 1/显示',
`rank` int(11) NOT NULL,
`lid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land_mine`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land_mine` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`lid` int(11) NOT NULL COMMENT '土地ID',
`count` int(11) NOT NULL COMMENT '数量',
`day` int(11) NOT NULL COMMENT '天数',
`exprie_time` int(11) NOT NULL COMMENT '到期时间',
`create_time` int(11) NOT NULL COMMENT '购买时间',
`status` tinyint(1) NOT NULL COMMENT '0/未种植 1/已种植 2/到期 ',
`uniacid` int(11) NOT NULL,
`send_day` int(11) NOT NULL COMMENT '种植天数',
`order_id` int(11) NOT NULL COMMENT '订单ID',
`web_did` char(200) NOT NULL,
`watering_update` int(11) NOT NULL,
`fertilization_update` int(11) NOT NULL,
`weeding_update` int(11) NOT NULL,
`insecticide_update` int(11) NOT NULL,
`weeding_tag` tinyint(1) NOT NULL,
`insecticide_tag` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land_order` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`order_number` char(50) NOT NULL COMMENT '订单编号',
`total_price` float NOT NULL COMMENT '订单总价',
`create_time` int(11) NOT NULL,
`status` tinyint(4) NOT NULL COMMENT '0/未支付 1/已支付',
`pay_time` int(11) NOT NULL COMMENT '支付时间',
`pra_price` float NOT NULL COMMENT '实际支付金额',
`uid` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`pay_method` char(50) NOT NULL COMMENT '支付方式',
`body` char(100) NOT NULL,
`username` char(100) NOT NULL,
`phone` char(20) NOT NULL,
`coupon_id` int(11) NOT NULL,
`coupon_price` float NOT NULL,
`uniontid` char(200) NOT NULL,
`is_price` tinyint(1) NOT NULL,
`one_price` float NOT NULL,
`two_price` float NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land_order_detail`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land_order_detail` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`order_id` int(11) NOT NULL COMMENT '订单ID',
`land_price` float NOT NULL COMMENT '土地单价',
`day_price` float NOT NULL COMMENT '年限价格',
`land_count` int(11) NOT NULL COMMENT '购买地数量',
`day` int(11) NOT NULL COMMENT '天数',
`uniacid` int(11) NOT NULL,
`lid` int(11) NOT NULL COMMENT '土地编号',
`land_name` char(100) NOT NULL COMMENT '土地名称',
`cover` text NOT NULL COMMENT '封面',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_land_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_land_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(50) NOT NULL,
`rank` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`slide` text NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_live`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_live` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`src` text NOT NULL COMMENT '直播地址',
`cover` text NOT NULL COMMENT '封面图片',
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`title` char(200) NOT NULL COMMENT '标题',
`type_id` int(11) NOT NULL,
`status` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_live_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_live_type` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`name` char(100) NOT NULL,
`rank` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`status` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_problem`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_problem` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_id` int(11) NOT NULL COMMENT '分类id',
`problem_title` char(200) NOT NULL COMMENT '问题标题',
`problem_value` text NOT NULL COMMENT '问题答案',
`create_time` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/不显示 1/显示',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_problem_type`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_problem_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type_name` char(50) NOT NULL COMMENT '分类名称',
`pid` int(11) NOT NULL COMMENT '父分类',
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/关闭 1/开启',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_sale_price_record`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_sale_price_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '用户uid',
`one_sale_uid` int(11) NOT NULL COMMENT '一级下线uid',
`remark` char(200) NOT NULL COMMENT '备注',
`price` float NOT NULL COMMENT '金额',
`do_type` tinyint(1) NOT NULL COMMENT '1/加 2/减',
`create_time` int(11) NOT NULL COMMENT '记录时间',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`order_type` tinyint(4) NOT NULL COMMENT '1/普通商城 2/组团商城 3/畜牧 4/土地',
`order_id` int(11) NOT NULL COMMENT '订单号',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_send`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_send` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`send_name` char(100) NOT NULL COMMENT '种子名称',
`cover` text NOT NULL COMMENT '封面',
`send_slide` text NOT NULL COMMENT '轮播图',
`price` float NOT NULL COMMENT '价格',
`output` char(100) NOT NULL COMMENT '产量',
`effect` text NOT NULL COMMENT '作用',
`send_time` char(100) NOT NULL COMMENT '播种时间',
`cycle` char(100) NOT NULL COMMENT '生长周期',
`uniacid` int(11) NOT NULL,
`is_putaway` tinyint(1) NOT NULL COMMENT '0/下架1/上架',
`rank` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_send_mine`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_send_mine` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`order_id` int(11) NOT NULL COMMENT '订单编号',
`sid` int(11) NOT NULL COMMENT '种子ID',
`status` tinyint(1) NOT NULL COMMENT '0/带种植 1/已种植 2/已成熟 3/已摘取',
`day` int(11) NOT NULL COMMENT '种植天数',
`send_name` char(100) NOT NULL COMMENT '种子名称',
`count` int(11) NOT NULL COMMENT '数量',
`uniacid` int(11) NOT NULL,
`lid` int(11) NOT NULL COMMENT '土地ID',
`seed_time` int(11) NOT NULL COMMENT '播种时间',
`expect_time` int(11) NOT NULL COMMENT '预计成熟时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_send_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_send_order` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`order_number` char(50) NOT NULL,
`uid` int(11) NOT NULL,
`total_price` float NOT NULL,
`create_time` int(11) NOT NULL,
`status` tinyint(4) NOT NULL COMMENT '0/未支付 1/已支付',
`pra_price` float NOT NULL,
`pay_method` char(100) NOT NULL,
`uniacid` int(11) NOT NULL,
`pay_time` int(11) NOT NULL,
`body` char(100) NOT NULL,
`coupon_id` int(11) NOT NULL,
`coupon_price` float NOT NULL,
`uniontid` char(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_send_order_detail`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_send_order_detail` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`order_id` int(11) NOT NULL COMMENT '订单ID',
`price` float NOT NULL,
`sid` int(11) NOT NULL,
`count` int(11) NOT NULL,
`send_name` char(100) NOT NULL,
`cover` text NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_send_status`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_send_status` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`lid` int(11) NOT NULL,
`txt` text NOT NULL,
`src` text NOT NULL,
`uniacid` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_set`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_set` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`ikey` char(50) NOT NULL COMMENT 'key',
`value` text NOT NULL COMMENT '值',
`uniacid` int(11) NOT NULL COMMENT '11',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_shop_coupon`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_shop_coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`coupon_name` char(100) NOT NULL COMMENT '优惠券名称',
`coupon_type` tinyint(1) NOT NULL COMMENT '1/满减',
`low_cash_price` float NOT NULL COMMENT '最低消费金额',
`coupon_price` float NOT NULL COMMENT '优惠金额',
`expiry_date` tinyint(4) NOT NULL COMMENT '1/n天内有效 2/时间段',
`expiry_day` int(11) NOT NULL COMMENT '有效天数',
`begin_time` int(11) NOT NULL COMMENT '优惠券开始时间',
`end_time` int(11) NOT NULL COMMENT '优惠券结算时间',
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/关闭 1/开启',
`uniacid` int(11) NOT NULL,
`create_time` int(11) NOT NULL COMMENT '创建时间',
`count` int(11) NOT NULL COMMENT '优惠券数量',
`use_count` int(11) NOT NULL COMMENT '使用数量',
`type` tinyint(4) NOT NULL COMMENT '1/普通商城 2/组团商城 3/畜牧 4/土地 5/种子',
`is_delete` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_shop_order`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_shop_order` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`order_number` char(50) NOT NULL,
`uid` int(11) NOT NULL,
`total_price` float NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/待支付 1/待配送 2/配送中 3/已完成 4/申请取消 5/已取消',
`pay_time` int(11) NOT NULL,
`create_time` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`remark` char(200) NOT NULL,
`name` char(20) NOT NULL,
`address` char(200) NOT NULL,
`phone` char(20) NOT NULL,
`pay_method` char(20) NOT NULL,
`pra_price` float NOT NULL,
`send_number` char(30) NOT NULL COMMENT '快递单号',
`express_company` char(50) NOT NULL COMMENT '快递公司',
`order_type` tinyint(1) NOT NULL COMMENT '0/普通1/组团/2积分3/家畜寄送',
`send_price` float NOT NULL COMMENT '运费',
`add_price` float NOT NULL COMMENT '加工费',
`group_status` tinyint(1) NOT NULL COMMENT '0/待支付 6/组团中 1/待配送 2/配送中 3/已完成 4/申请取消 5/已取消',
`is_add` tinyint(4) NOT NULL COMMENT '0/不加工1/腊肉 2香肠',
`body` char(200) NOT NULL,
`coupon_id` int(11) NOT NULL,
`coupon_price` float NOT NULL,
`use_is_delete` tinyint(1) NOT NULL COMMENT '是否删除0/1',
`uniontid` char(200) NOT NULL,
`is_price` tinyint(1) NOT NULL,
`one_price` float NOT NULL,
`two_price` float NOT NULL,
`is_recycel` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_shop_order_detail`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_shop_order_detail` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`goods_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`goods_name` char(200) NOT NULL,
`cover` text NOT NULL,
`price` float NOT NULL,
`count` int(11) NOT NULL,
`spec_id` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_sign`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_sign` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`sign_time` int(11) NOT NULL COMMENT '签到时间',
`uniacid` int(11) NOT NULL,
`score` int(11) NOT NULL COMMENT '签到获取的积分',
`year` int(11) NOT NULL COMMENT '年',
`month` int(11) NOT NULL COMMENT '月',
`day` int(11) NOT NULL COMMENT '天',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_slide`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_slide` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`slide_src` text NOT NULL COMMENT '轮播图片',
`slide_type` tinyint(1) NOT NULL COMMENT '1/首页轮播图 2商城 3/积分商城',
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/关闭1/开启',
`link_type` char(100) NOT NULL COMMENT '链接类型',
`link_param` char(100) NOT NULL COMMENT 'l链接参数',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_spec`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_spec` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`name` char(100) NOT NULL COMMENT '规格名称',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_spec_value`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_spec_value` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`spec_id` int(11) NOT NULL COMMENT '规格id',
`spec_value` char(100) NOT NULL COMMENT '规格值',
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_user`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_user` (
`id` int(11) NOT NULL COMMENT '自增id' AUTO_INCREMENT,
`uid` int(11) NOT NULL COMMENT '微擎uid',
`nickname` char(30) NOT NULL COMMENT '昵称',
`avatarurl` text NOT NULL COMMENT '头像',
`phone` char(20) NOT NULL COMMENT '电话',
`create_time` int(11) NOT NULL COMMENT '创建时间',
`uniacid` int(11) NOT NULL COMMENT '小程序id',
`address` char(100) NOT NULL COMMENT '地址',
`openid` char(50) NOT NULL,
`score` float NOT NULL COMMENT '积分',
`continue_day` int(11) NOT NULL COMMENT '连续签到天数',
`is_distributor` tinyint(1) NOT NULL,
`one_distributor` int(11) NOT NULL,
`become_time` int(11) NOT NULL,
`total_price` float NOT NULL,
`price` float NOT NULL,
`money` float NOT NULL,
`share_qrcode` text NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_user_coupon`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_user_coupon` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`cid` int(11) NOT NULL COMMENT '优惠券id',
`create_time` int(11) NOT NULL COMMENT '领取时间',
`uniacid` int(11) NOT NULL,
`status` tinyint(1) NOT NULL COMMENT '0/未使用1/已使用',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_vet`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_vet` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(50) NOT NULL COMMENT '名字',
`head_img` text NOT NULL COMMENT '头像',
`introduce` text NOT NULL COMMENT '描述',
`certificate` text NOT NULL COMMENT '证书图片',
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_webapp_slide`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_webapp_slide` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`slide_src` text NOT NULL,
`uniacid` int(11) NOT NULL,
`rank` int(11) NOT NULL,
`status` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_webappset`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_webappset` (
`id` int(11) NOT NULL COMMENT 'id' AUTO_INCREMENT,
`ikey` char(200) NOT NULL COMMENT 'key',
`value` text NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_withdraw`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_withdraw` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
`price` float NOT NULL COMMENT '提现金额',
`status` tinyint(1) NOT NULL COMMENT '0/待审核 1/已打款 2/已拒绝',
`create_time` int(11) NOT NULL,
`wx_account` char(200) NOT NULL,
`name` char(50) NOT NULL,
`uniacid` tinyint(11) NOT NULL,
`remark` char(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `ims_cqkundian_farm_wx_set`;
CREATE TABLE IF NOT EXISTS `ims_cqkundian_farm_wx_set` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL,
`wx_appid` char(100) NOT NULL COMMENT '微信公众号appid',
`wx_secret` char(200) NOT NULL COMMENT '微信密钥',
`wx_template_order_id` char(200) NOT NULL COMMENT '订单推送模板（店家）',
`wx_small_template_id` char(200) NOT NULL COMMENT '订单推送模板',
`get_openid` text NOT NULL COMMENT '接收推送id',
`wx_cert` text NOT NULL,
`wx_key` text NOT NULL,
`wx_shop_template_id` char(200) NOT NULL COMMENT '订单通知模板消息',
`longitude` char(100) NOT NULL,
`latitude` char(100) NOT NULL,
`appcode` char(100) NOT NULL,
`is_open_weather` tinyint(1) NOT NULL,
`wx_cancel_template_id` char(200) NOT NULL,
`mini_device_template_id` char(200) NOT NULL,
`mini_services_template_id` char(200) NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");
